<%-- 
    Document   : Modules
    Created on : Jan 7, 2012, 12:27:20 AM
    Author     : User
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/struts-tags" prefix="s" %>

<script type="text/javascript">
    $(function(){
        $("#resultsTable").tablesorter({
            headers : {
                9 : {
                    sorter : false
                }
            },
            sortList : [ [ 1, 0 ] ]
        });
    });
</script>

<br/>
<table>
    <tr>
        <td>
            <img src="<s:url value="/img/icons/components_big.png"/>"> 
        </td>
        <td>
            <span class="title">
                List all modules
            </span>
        </td>
    </tr>
</table>
<br/><br/>

<table id="resultsTable" cellspacing="1" cellpadding="1" class="tablesorter" style="width:850px;" border="1">
    <thead>
        <tr>
            <th>Module Code</th>
            <th>Title</th>
            <th>Type</th>
            <th>Owner</th>
            <th>Description</th>
            <th>Maximum Mark</th>
            <th>Weight</th>
            <th>Range</th>
            <th>Lecturers Teaching</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
        <s:iterator value="modules">
            <tr>
                <td><s:property value="moduleCode"/></td>
                <td><s:property value="title"/></td>
                <td><s:property value="type"/></td>
                <td><s:property value="owner"/></td>
                <td><s:property value="description"/></td>
                <td><s:property value="maximumMarks"/></td>
                <td><s:property value="weight"/></td>
                <td><s:property value="fromRange"/>-<s:property value="toRange" /></td>
                <td>
                    <s:iterator value="lecturerTeaching"><s:property value="username"/><br/></s:iterator>
                </td>
                <td>
                    <a href="<s:url namespace="/module" action="view_%{moduleCode}" />">
                        <img src="<s:url value="/img/icons/view.png"/>" border="0" alt="View"/>
                    </a>                      
                    <a href="<s:url namespace="/module" action="delete_%{moduleCode}" />">
                        <img src="<s:url value="/img/icons/delete.png"/>" border="0" alt="delete"/>
                    </a>
                </td>
            </tr>
        </s:iterator>
    </tbody>
</table>

